<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <style>
        body {
            position:relative;
            width:100%;
            height:100px;
        }
        #box {
            position:absolute;
            width:100px;
            height:100px;
            background-color:red;
            top:0px;
            left:0px;
            cursor:pointer;
        }
    </style>
</head>
<body>
    <div class="box" id="box"></div>
    <script type="text/javascript" src="/js/jquery-2.1.4.min.js"></script>
    <script type="text/javascript" src="/js/easing.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#box").click(function () {
                $(this).stop(true, true).animate({
                    left:'400px'
                },
                2000, 'easeInOutElastic',
                function () {
                    $(this).animate({
                        left: '0px'
                    }, 2000, 'easeInOutElastic');
                });
            });
        });
    </script>
</body>
</html>